<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PlanetWPF.Toolbelt.Controls"
    >
  <!--PowerGridRow ItemsControl Style-->
  <Style x:Key="RowScroller" 
           TargetType="{x:Type ItemsControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ItemsControl}">
          <VirtualizingStackPanel Orientation="Horizontal"
                      IsItemsHost="True" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--PowerGridRow-->
  <Style TargetType="{x:Type local:PowerGridRow}">
    <Setter Property="Template" >
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:PowerGridRow}">
          <!--Put row header cell here-->
          <ItemsControl Name="PART_ItemsControl"
                        Margin="0,0,0,0" 
                        Style="{StaticResource RowScroller}" 
                        ItemTemplate="{Binding 
                          RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type local:PowerGrid}},
                          Path=CellDataTemplate}"
                        ItemsSource="{TemplateBinding Columns}">
          </ItemsControl>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


</ResourceDictionary>